package org.chris.quick.tools;

import android.content.res.TypedArray;
import android.support.annotation.AttrRes;

/**
 * Created by work on 2017/8/4.
 *
 * @author chris zou
 * @mail chrisSpringSmell@gmail.com
 */

public class ViewUtils {

    public static boolean viewAttrHasValue(TypedArray typedArray, @AttrRes int attr) {
        for (int i = 0; i < typedArray.getIndexCount(); i++) {
            if (typedArray.getIndex(i) == attr) {
                return true;
            }
        }
        return false;
    }
}
